app.controller("topicCtrl", function ($scope, topicService, $timeout) {
    var msgBox = null;
    function findAllTopic() {
        topicService.findAllTopic(
            {action: 'findAllTopic'}, function (data) {
            if (data.state == 'SUCCESS') {
                $scope.topics = data.data.topicVO;
            } else {
                if(msgBox == null){
                    msgBox = message_alert('提示',data.reason,function(){
                        msgBox = null;
                    });
                }
            }
        });
        $timeout(function(){
            findAllTopic();
        },$scope.selectTime);
    };
    findAllTopic();
    $scope.changeTime = function (time) {
        $scope.selectTime = time;
    };
});


